package com.xuelang.pipeline.domain.application.service.impl;

import com.xuelang.pipeline.client.application.dto.TraitQuery;
import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.domain.application.Trait;
import com.xuelang.pipeline.domain.application.repository.TraitRepository;
import com.xuelang.pipeline.domain.application.service.TraitDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 运维特征领域服务实现类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Service
public class TraitDomainServiceImpl implements TraitDomainService {

    @Autowired
    private TraitRepository traintRepository;

    @Override
    public PageRecord<Trait> pageList(long currentPage, long pageSize, TraitQuery traintQuery) {
        return traintRepository.pageList(currentPage, pageSize, traintQuery);
    }

    @Override
    public List<Trait> list(TraitQuery traintQuery) {
        return traintRepository.list(traintQuery);
    }


    @Override
    public Boolean save(Trait traint) {
        return traintRepository.save(traint);
    }

    @Override
    public Boolean update(Trait traint) {
        return traintRepository.update(traint);
    }

    @Override
    public Boolean delete(Trait traint) {
        return traintRepository.delete(traint);
    }

    @Override
    public Trait query(Trait trait) {
        return traintRepository.query(trait);
    }

    @Override
    public Boolean deleteByComponentLabel(String componentLabel) {
        return traintRepository.deleteByComponentLabel(componentLabel);
    }

}
